﻿using System.Collections.Generic;

namespace Eneta.Portal.Common
{
    /// <summary>
    /// Class for strongly type paged results. This class is used to return paged results from 
    /// repositories to minimize object factoring operations.
    /// </summary>
    /// <typeparam name="T">Type of returned results.</typeparam>
    public class PagedResult<T>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PagedResult&lt;T&gt;"/> class.
        /// </summary>
        public PagedResult()
        {
            Results = new List<T>();
        }

        /// <summary>
        /// Gets or sets the current page of query results.
        /// </summary>
        public int Page { get; set; }

        /// <summary>
        /// Gets or sets the number of pages in query results.
        /// </summary>
        public int PageCount { get; set; }

        /// <summary>
        /// Gets or sets page size.
        /// </summary>
        public int PageSize { get; set;}

        /// <summary>
        /// Gets or sets list of elements in current page.
        /// </summary>
        public IList<T> Results { get; set; }
    }
}
